

//TODO a(15)
function a15(module, exports, a) {
    function i(e) {
        T[e.cont] = this, window.CdeMediaHelper ? CdeMediaHelper.init({
                appId: 800,
                logLevel: 14,
                logType: 2
            }, {
                fn: n.bind(function () {
                    this.init(e)
                }, this)
            }) : this.init(e)
    }

    var s = a(16), r = a(6), n = a(3), o = a(2), l = a(21), d = a(22), h = a(28), c = a(30), p = a(31), u = a(32), g = a(34), f = a(35), v = a(36), m = a(37), _ = a(46), y = a(64), b = a(65), T = {};
    i.prototype = {
        init: function (config) {
            this.playerData = c(config), 1 == this.playerData.flashVar.isHttps && (l.PROTOCAL = "https://", l.HOST_NAME.PLAYER_PC_LETV_COM = "player-pc.le.com", l.HOST_NAME.D_APi_M_LETV_COM = "d-api-m.le.com");
            var t = {
                vid: this.playerData.flashVar.id || this.playerData.flashVar.vid,
                pid: "",
                mmsid: "",
                up: 0,
                history: this.playerData.urlParams.htime
            };
            n.merge(this.playerData.vinfo, t), this.lanFit = new d(this.playerData.config.lan, "normal");
            var a = this.render();
            this.IPlayer = this.initInterface(), this.user = new u, this.pingback = new h, this.baseVideo = new g(a.video[0]), this.coreVideo = this.playerData.config.supportP2P ? new v(this.baseVideo) : new f(this.baseVideo), this.fullScreen = new y, this.component = new _(this.playerData.tplType, a), this.barrage = new b(a), this.controller = new m(this.fullScreen), this.manager = new s(this.playerData, this.user, this.pingback, this.coreVideo, this.lanFit), this.manager.evt.on(l.EVENT.PLAYER_CALLBACK, this.playerCallback, this), this.manager.register(this.pingback), this.manager.register(this.user), this.manager.register(this.baseVideo), this.manager.register(this.coreVideo), this.manager.register(this.component), this.manager.register(this.controller), this.manager.register(this.fullScreen), this.manager.log.pushLog("playerData: " + n.JSONTOStr(this.playerData)), this.manager.listener.set(l.REGION, this.playerData.flashVar.region || "cn"), this.pingback.sendEnv(), this.manager.evt.on("vjs_p2pError", function () {
                this.manager.log.pushLog("p2p模块异常，尝试正常cdn请求"), this.manager.coreVideo.release(), this.playerData.config.supportP2P = !1, this.coreVideo = new f(this.baseVideo), this.manager.register(this.coreVideo), this.manager.coreVideo = this.coreVideo, this.controller.startPlayProcesses(!0)
            }, this), this.manager.evt.on("vjs_danmuSucc", this.setBarrage, this)
        }, setBarrage: function () {
            this.playerData.config.Barrage && (this.manager.register(this.barrage), this.manager.listener.set(l.BARRAGE_STATE, !0))
        }, getTplType: function () {
            var e;
            return e = o.Notplayinline ? "IPhone" : "simple" == this.playerData.flashVar.UIType ? "simple" : "min" == this.playerData.flashVar.UIType ? "minBase" : Math.min(window.innerWidth, window.innerHeight) > 320 ? "base" : "minBase"
        }, loadCss: function () {
            var e = document.head || document.getElementsByTagName("head")[0] || document.documentElement, t = document.createElement("style");
            styleIENode = document.createElement("style"), document.getElementById("player-sdk-css") || (t.setAttribute("type", "text/css"), t.setAttribute("id", "player-sdk-css"), t.innerHTML = p.getCss(this.playerData.tplType, this.playerData.flashVar.isHttps), e.appendChild(t), o.IE9 && (styleIENode.setAttribute("type", "text/css"), styleIENode.innerHTML = p.getIECss(this.playerData.tplType), e.appendChild(styleIENode)))
        }, render: function () {
            this.playerData.tplType = this.getTplType(), this.loadCss();
            var e, t = this.playerData.config.cont;
            if (/^#/.test(t) || (t = "#" + t), e = r(t), !e || !e.length || !e[0].nodeName)throw new TypeError("The element or ID supplied is not valid.");
            var a = p.getTpl(this.playerData.tplType, n.bind(this.lanFit.fit, this.lanFit), this.playerData.flashVar.isHttps);
            e[0].innerHTML = a;
            var i = {cont: e, parentEl: e.find(".hv_box"), video: e.find("video")};
            return i.parentEl.addClass("hv_" + this.playerData.config.lan), i
        }, initInterface: function () {
            var e = this.playerData.flashVar.callbackJs;
            return "function" == typeof window[e] ? window[e] : new Function
        }, playerCallback: function () {
            var e = arguments[0].args ? arguments[0].args[0] : arguments[0], t = arguments[0].args ? arguments[0].args[1] : arguments[1] || {};
            this.manager.log.pushLog("playerCallback status: " + e + ";data: " + n.JSONTOStr(t));
            try {
                var a = this.IPlayer(e, t);
                switch (e) {
                    case"PLAYER_VIDEO_COMPLETE":
                    case"PLAYER_PLAY_NEXT":
                        a = a || {}, a.status && "playerContinue" != a.status || !this.playerData.vinfo.nextvid || this.playNewId(this.playerData.vinfo.nextvid);
                        break;
                    case"CHANGE_FULLSCREEN":
                        a = o.isPC || !a ? "system" : a, this.fullScreen.changeFullScreen({
                            type: a,
                            targetState: t.flag
                        })
                }
            } catch (i) {
                console.log("调取页面接口失败" + e + "===" + n.JSONTOStr(t))
            }
        }, playNewId: function (e, t) {
            this.manager.log.pushLog("interface playNewId: " + e), t = t || {}, n.clearObj(this.playerData.vinfo), this.playerData.vinfo.vid = e, this.playerData.vinfo.up = 1, this.playerData.vinfo.appGuideTime = t.appGuideTime, this.controller.startPlayProcesses()
        }, setVip: function () {
            this.manager.log.pushLog("interface setVip"), this.user.getUserInfo()
        }, seekTo: function (e) {
            this.manager.log.pushLog("interface seek: " + e), "stop" != this.manager.listener.get(l.PLAY_STATE) && this.manager.evt.trigger(l.EVENT.PLAYER_COMMAND, "seek", e)
        }, pauseVideo: function () {
            this.manager.log.pushLog("interface pauseVideo"), "stop" != this.manager.listener.get(l.PLAY_STATE) && this.manager.evt.trigger(l.EVENT.PLAYER_COMMAND, "pause")
        }, resumeVideo: function () {
            this.manager.log.pushLog("interface resumeVideo"), "stop" != this.manager.listener.get(l.PLAY_STATE) && this.manager.evt.trigger(l.EVENT.PLAYER_COMMAND, "play")
        }, destroy: function () {
            this.manager.log.pushLog("interface destroy"), this.manager.listener.set(l.PLAY_STATE, "stop"), this.manager.evt.trigger(l.EVENT.PLAYER_COMMAND, "pause")
        }, resize: function () {
            this.manager.log.pushLog("interface resize"), this.manager.evt.trigger(l.EVENT.RESIZE)
        }, getCurrTime: function () {
            var e = this.manager.curVideo.getCurrentTime();
            return 0 == e && o.mac && o.qq ? "unknown" : e
        }, changeDefi: function (e) {
            this.manager.log.pushLog("interface changeDefi: " + e), "stop" != this.manager.listener.get(l.PLAY_STATE) && this.manager.evt.trigger(l.EVENT.PLAYER_COMMAND, "changeDefi", e)
        }, setChangeBarrage: function (e) {
            this.manager.evt.trigger("vjs_setBarrageState", e)
        }, pushBarrageData: function (e) {
            this.manager.evt.trigger("vjs_pushBarrageData", e)
        }, setEffectBarrage: function (e) {
            this.manager.evt.trigger("vjs_setEffectBarrage", e)
        }, changeFullScreen: function (e) {
            this.manager.log.pushLog("interface changeFullScreen: " + e), o.iPhone && !o.weixin ? flag = e ? 2 : 0 : flag = e ? 1 : 0, this.manager.evt.trigger(l.EVENT.PLAYER_COMMAND, "changFullScreen", flag)
        }, getFullScreenState: function () {
            return this.manager.listener.get(l.FULLSCREEN_STATE)
        }, togglePlayer: function (e) {
            this.manager.log.pushLog("interface togglePlayer: " + e), e || this.manager.curVideo.pause(), this.component.togglePlayer(e)
        }, setChangeInteractive: function () {
            return !1
        }, getVideoInfo: function () {
            var e = this.playerData.vinfo;
            return {vid: e.vid, pid: e.pid, cid: e.cid, nextvid: e.nextvid, duration: e.gdur, title: e.title}
        }
    }, module.exports = i
}
